-- floor
-- created by panyl
-- 通过的层数

local handle = function(para)
    -- 如果不是在地牢内就忽略
    if not DungeonM.isInDungeon() then
        return;
    end

    local curfloor = DungeonM.currentLayer();

    -- 已探索的迷宫层数
    local addPoints = PropStatM.getData1(ME.user, "floor_bonus");
    addPoints = curfloor;
    PropStatM.setData1(ME.user, "floor_bonus", addPoints);

    -- 触发prop
    local props = PropM.fetchProps(ME.user, "floor_bonus");
    for _, prop in ipairs(props) do
        PropM.trigger(ME.user, prop[1], prop[2]);
    end
end

EventMgr.register("prop_stat/floor", event.NEXT_FLOOR, handle);
EventMgr.register("prop_stat/floor", event.START_DUNGEON, handle);